import { del, get, post, put } from "@/utils/request";
import { type AddParams, type ListData, type ListParams, type ListResult } from "./type";

export const getBloodSugarList = (data: ListParams) => {
  return get<ListParams, ListResult>("/api/bloodSugar/list", data);
};

//添加
export const addBloodSugar = (data: AddParams) => {
  return post<AddParams, ListData>("/api/bloodSugar/add", data);
};
//修改
export const updateBloodSugar = (data: AddParams) => {
  return put<AddParams, ListData>("/api/bloodSugar/update", data);
};
//获取单条
export const getBloodSugarModel = (id: number) => {
  return get<null, ListData>(`/api/bloodSugar/get/${id}`);
};
//删除
export const delBloodSugar = (id: number) => {
  return del<null, null>(`/api/bloodSugar/delete/${id}`);
};
//批量删除
export const delBloodSugarMany = (ids: number[]) => {
  return post<number[], null>("/api/bloodSugar/deleteAll", ids);
};
